home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gdk / gdkkeys.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  4.5 KB  |  124 lines

  1. /* GDK - The GIMP Drawing Kit
  2.  * Copyright (C) 2000 Red Hat, Inc.
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  25.  */
  26.  
  27. #ifndef __GDK_KEYS_H__
  28. #define __GDK_KEYS_H__
  29.  
  30. #include <gdk/gdktypes.h>
  31.  
  32. G_BEGIN_DECLS
  33.  
  34. typedef struct _GdkKeymapKey GdkKeymapKey;
  35.  
  36. /* GdkKeymapKey is a hardware key that can be mapped to a keyval */
  37. struct _GdkKeymapKey
  38. {
  39.   guint keycode;
  40.   gint  group;
  41.   gint  level;
  42. };
  43.  
  44. /* A GdkKeymap defines the translation from keyboard state
  45.  * (including a hardware key, a modifier mask, and active keyboard group)
  46.  * to a keyval. This translation has two phases. The first phase is
  47.  * to determine the effective keyboard group and level for the keyboard
  48.  * state; the second phase is to look up the keycode/group/level triplet
  49.  * in the keymap and see what keyval it corresponds to.
  50.  */
  51.  
  52. typedef struct _GdkKeymap      GdkKeymap;
  53. typedef struct _GdkKeymapClass GdkKeymapClass;
  54.  
  55. #define GDK_TYPE_KEYMAP              (gdk_keymap_get_type ())
  56. #define GDK_KEYMAP(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_KEYMAP, GdkKeymap))
  57. #define GDK_KEYMAP_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_KEYMAP, GdkKeymapClass))
  58. #define GDK_IS_KEYMAP(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_KEYMAP))
  59. #define GDK_IS_KEYMAP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_KEYMAP))
  60. #define GDK_KEYMAP_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_KEYMAP, GdkKeymapClass))
  61.  
  62. struct _GdkKeymap
  63. {
  64.   GObject     parent_instance;
  65.   GdkDisplay *display;
  66. };
  67.  
  68. struct _GdkKeymapClass
  69. {
  70.   GObjectClass parent_class;
  71.  
  72.   void (*direction_changed) (GdkKeymap *keymap);
  73.   void (*keys_changed)      (GdkKeymap *keymap);
  74. };
  75.  
  76. GType gdk_keymap_get_type (void) G_GNUC_CONST;
  77.  
  78. #ifndef GDK_MULTIHEAD_SAFE
  79. GdkKeymap* gdk_keymap_get_default     (void);
  80. #endif
  81. GdkKeymap* gdk_keymap_get_for_display (GdkDisplay *display);
  82.  
  83.  
  84. guint          gdk_keymap_lookup_key               (GdkKeymap           *keymap,
  85.                             const GdkKeymapKey  *key);
  86. gboolean       gdk_keymap_translate_keyboard_state (GdkKeymap           *keymap,
  87.                             guint                hardware_keycode,
  88.                             GdkModifierType      state,
  89.                             gint                 group,
  90.                             guint               *keyval,
  91.                             gint                *effective_group,
  92.                             gint                *level,
  93.                             GdkModifierType     *consumed_modifiers);
  94. gboolean       gdk_keymap_get_entries_for_keyval   (GdkKeymap           *keymap,
  95.                             guint                keyval,
  96.                             GdkKeymapKey       **keys,
  97.                             gint                *n_keys);
  98. gboolean       gdk_keymap_get_entries_for_keycode  (GdkKeymap           *keymap,
  99.                             guint                hardware_keycode,
  100.                             GdkKeymapKey       **keys,
  101.                             guint              **keyvals,
  102.                             gint                *n_entries);
  103. PangoDirection gdk_keymap_get_direction            (GdkKeymap           *keymap);
  104.  
  105. /* Key values
  106.  */
  107. gchar*   gdk_keyval_name         (guint        keyval) G_GNUC_CONST;
  108. guint    gdk_keyval_from_name    (const gchar *keyval_name);
  109. void     gdk_keyval_convert_case (guint        symbol,
  110.                   guint       *lower,
  111.                   guint       *upper);
  112. guint    gdk_keyval_to_upper     (guint        keyval) G_GNUC_CONST;
  113. guint    gdk_keyval_to_lower     (guint        keyval) G_GNUC_CONST;
  114. gboolean gdk_keyval_is_upper     (guint        keyval) G_GNUC_CONST;
  115. gboolean gdk_keyval_is_lower     (guint        keyval) G_GNUC_CONST;
  116.  
  117. guint32  gdk_keyval_to_unicode   (guint        keyval) G_GNUC_CONST;
  118. guint    gdk_unicode_to_keyval   (guint32      wc) G_GNUC_CONST;
  119.  
  120.  
  121. G_END_DECLS
  122.  
  123. #endif /* __GDK_KEYS_H__ */
  124.